<template>
  <el-card>
    <div class="box">
      <img :src="avatar" alt="" class="avatar" />
      <div class="bottom">
        <h3 class="title">{{ getTime() }}好呀{{ userStore.username }}</h3>
        <p style="font-style: italic; color: skyblue">{{ setting.title }}</p>
      </div>
    </div>
  </el-card>
  <div class="welcome">
    <svg-icon name="welcome" width="600px" height="800px"></svg-icon>
  </div>
</template>

<script setup lang="ts">
//引入用户相关的仓库，获取当前用户的头像、昵称
import useUserStore from '@/store/modules/user'
import { getTime } from '@/utils/time'
//获取存储用户信息的仓库对象
let userStore = useUserStore()
import setting from '@/setting'
import { ref } from 'vue'
let avatar = ref<string>(userStore.avatar as string)
</script>

<style scoped lang="scss">
.box {
  display: flex;
  align-items: center;
  .avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
  }
  .bottom {
    margin-left: 20px;
    .title {
      font-size: 30px;
      font-weight: 900;
      margin-bottom: 30px;
    }
  }
}
.welcome {
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
